package cn.hxth.dubbo.customer.controller;

import cn.hxth.api.model.ProductName;
import cn.hxth.api.service.IProductNameService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/pages/productName/")
public class ProductNameController {
    @Resource
    private IProductNameService productNameService ;
    @RequestMapping("insertProductName")
    public  boolean insertProductName(ProductName Name) {
        return  this.productNameService.insertProductName(Name) ;
    }
    @RequestMapping("deleteProductName")
    public  boolean deleteProductName(int sid,int nid){
        return  this.productNameService.deleteProductName(nid) ;
    }
    @RequestMapping("findAll")
    public List<ProductName> findAll() {
        return this.productNameService.findAll() ;
    }
    @ResponseBody
    @RequestMapping("getProductNameForMq")
    // 获取单个商品名称信息(mq使用)
    public ProductName getProductNameForMq(int nid) {
        return this.productNameService.getProductName(nid) ;
    }
}
